#coding=utf-8

'''
group()
'''
import re


s = 'life is short,i use python,i love python'
result = re.search('life(.*)python(.*)python',s)
print(result.group(0))
print(result.group(1))
print(result.group(2))

#or
print(result.group(0,1,2))

#or
print(result.groups()) #排除group(0)
